package com.androidx.p013lv.base.model;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.androidx.p013lv.base.bean.OnLineServiceBean;
import com.androidx.p013lv.base.bean.UserInfo;
import com.androidx.p013lv.base.http.BaseRes;
import com.androidx.p013lv.base.http.HttpUtils;
import com.androidx.p013lv.base.http.JsonParams;
import com.androidx.p013lv.base.http.UrlManager;
import com.androidx.p013lv.base.http.callback.HttpCallback;

/* renamed from: com.androidx.lv.base.model.UserInfoModel */
public class UserInfoModel extends ViewModel {
    private MutableLiveData<BaseRes<OnLineServiceBean>> onlineServiceData;
    private MutableLiveData<BaseRes<UserInfo>> userInfoData;

    public MutableLiveData<BaseRes<OnLineServiceBean>> getOnlineServiceData() {
        if (this.onlineServiceData == null) {
            this.onlineServiceData = new MutableLiveData<>();
        }
        return this.onlineServiceData;
    }

    public MutableLiveData<BaseRes<UserInfo>> data() {
        if (this.userInfoData == null) {
            this.userInfoData = new MutableLiveData<>();
        }
        return this.userInfoData;
    }

    public void getUserInfo() {
        HttpUtils.getInsatance().post(UrlManager.getInsatance().userInfo(), JsonParams.build().commit(), new HttpCallback<BaseRes<UserInfo>>("userInfo") {
            /* class com.androidx.p013lv.base.model.UserInfoModel.C10311 */

            public void onLvSuccess(BaseRes<UserInfo> baseRes) {
                UserInfoModel.this.userInfoData.setValue(baseRes);
            }
        });
    }

    public void setOnlineServiceData() {
        HttpUtils.getInsatance().get(UrlManager.getInsatance().getH5Url(), new HttpCallback<BaseRes<OnLineServiceBean>>("getH5Url") {
            /* class com.androidx.p013lv.base.model.UserInfoModel.C10322 */

            public void onLvSuccess(BaseRes<OnLineServiceBean> baseRes) {
                UserInfoModel.this.onlineServiceData.setValue(baseRes);
            }
        });
    }

    public void cancelHttp() {
        HttpUtils.getInsatance().cancelTag("userInfo");
        HttpUtils.getInsatance().cancelTag("getH5Url");
    }
}
